from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.core.window import Window
from kivy.metrics import Metrics
print(Metrics.density)#一英寸包含72个像素， 2.0就表示 一英寸里面包含144个像素

# print(Metrics.dpi)#实际的像素密度



Window.size = (1000,500)
class MyApp(App):
    def build(self):
        layout = FloatLayout()
        btn = Button(text="click me",size_hint_max=("400px","300px"))
        btn1 = Button(text="click1 me", size_hint_max=("800px", "100px"))
        layout.add_widget(btn)
        layout.add_widget(btn1)
        return layout

if __name__ == '__main__':
    MyApp().run()